const rand = require('./rand');
//函数 percent(20)
function percent(p){
    //获得从 1-100 的随机数
    let num = rand(1, 100);
    //判断
    if(num <= p) return true;
    else return false;
}

//使用 exports.xx 暴露 
exports.percent = percent;
//等效于  module.exports = {percent: percent}